package com.ruoyi.slope.electricity.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.slope.electricity.mapper.SlopeElectricityDataMapper;
import com.ruoyi.slope.electricity.domain.SlopeElectricityData;
import com.ruoyi.slope.electricity.service.ISlopeElectricityDataService;

/**
 * 电量信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-15
 */
@Service
public class SlopeElectricityDataServiceImpl implements ISlopeElectricityDataService 
{
    @Autowired
    private SlopeElectricityDataMapper slopeElectricityDataMapper;

    /**
     * 查询电量信息
     * 
     * @param id 电量信息主键
     * @return 电量信息
     */
    @Override
    public SlopeElectricityData selectSlopeElectricityDataById(Long id)
    {
        return slopeElectricityDataMapper.selectSlopeElectricityDataById(id);
    }

    /**
     * 查询电量信息列表
     * 
     * @param slopeElectricityData 电量信息
     * @return 电量信息
     */
    @Override
    public List<SlopeElectricityData> selectSlopeElectricityDataList(SlopeElectricityData slopeElectricityData)
    {
        return slopeElectricityDataMapper.selectSlopeElectricityDataList(slopeElectricityData);
    }

    /**
     * 新增电量信息
     * 
     * @param slopeElectricityData 电量信息
     * @return 结果
     */
    @Override
    public int insertSlopeElectricityData(SlopeElectricityData slopeElectricityData)
    {
        return slopeElectricityDataMapper.insertSlopeElectricityData(slopeElectricityData);
    }

    /**
     * 修改电量信息
     * 
     * @param slopeElectricityData 电量信息
     * @return 结果
     */
    @Override
    public int updateSlopeElectricityData(SlopeElectricityData slopeElectricityData)
    {
        slopeElectricityData.setUpdateTime(DateUtils.getNowDate());
        return slopeElectricityDataMapper.updateSlopeElectricityData(slopeElectricityData);
    }

    /**
     * 批量删除电量信息
     * 
     * @param ids 需要删除的电量信息主键
     * @return 结果
     */
    @Override
    public int deleteSlopeElectricityDataByIds(Long[] ids)
    {
        return slopeElectricityDataMapper.deleteSlopeElectricityDataByIds(ids);
    }

    /**
     * 删除电量信息信息
     * 
     * @param id 电量信息主键
     * @return 结果
     */
    @Override
    public int deleteSlopeElectricityDataById(Long id)
    {
        return slopeElectricityDataMapper.deleteSlopeElectricityDataById(id);
    }
}
